package com.mentaleye.dal.dao.mybatis;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.mentaleye.dal.dao.PropertyDao;

import com.mentaleye.dal.model.Property;
import com.mentaleye.dal.model.PropertyExample;
import com.mentaleye.dal.service.PropertyMapper;

@Repository
public class PropertyDaoImpl extends BaseDao  implements PropertyDao{

	
	@Autowired private PropertyMapper dataMapper;

	public boolean insertRecord(Property record) {
		boolean isSuccess=false;
		if(this.dataMapper.insert(record)>0){
			isSuccess=true;
		}
	    return isSuccess;
	}

	@Override
	public boolean insertByList(List<Property> recordList) {
		boolean isSuccess=false;
		if(this.dataMapper.insertByList(recordList)>0){
			isSuccess=true;
		}
	    return isSuccess;
	}
	
	public boolean updateRecord(Property record) {
		boolean isSuccess=false;
		if(this.dataMapper.updateByPrimaryKey(record)>0){
			isSuccess=true;
		}
	    return isSuccess;
	}

	@Override
	public boolean updateRecordBySelective(PropertyExample example, Property record) {
		boolean isSuccess=false;
		if(this.dataMapper.updateByExampleSelective(record, example)>0){
			isSuccess=true;
		}
		return isSuccess;
	}
	
	public boolean deleteByExample(PropertyExample example) {
		boolean isSuccess=false;
		if(this.dataMapper.deleteByExample(example)>0){
			isSuccess=true;
		}
	    return isSuccess;
	}


	public List<Map<String, Object>> getListByMap(Map<String, Object> map) {
		return this.dataMapper.getListByMap(map);
	}

	
	public List<Property> getListByExample(PropertyExample example) {
		return this.dataMapper.selectByExample(example);
	}
}
